package Demo3;

import java.lang.reflect.Method;

public class AnnoDemo {
    public static void main(String[] args) throws Exception {
        Class clazz = Class.forName("Demo3.UseTest");
        UseTest useTest = (UseTest) clazz.newInstance();
        Method[] methods = clazz.getDeclaredMethods();
        for (Method method : methods) {
            // System.out.println(method);
            if (method.isAnnotationPresent(Test.class)) {
                method.invoke(useTest);
            }
        }
    }
}
